package ink.xiaobaibai.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author xiaobaibai
 * @since 2021-06-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("buy_order")
@NoArgsConstructor
public class BuyOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    public BuyOrder(String orderId, BigDecimal amount, Integer clientUserId, Integer adminUserId, Integer adminDepId, String status) {
        this.orderId = orderId;
        this.amount = amount;
        this.clientUserId = clientUserId;
        this.adminUserId = adminUserId;
        this.adminDepId = adminDepId;
        this.status = status;
    }

    public BuyOrder(String orderId, BigDecimal amount, Integer clientUserId, Integer adminUserId, Integer adminDepId, Integer logisticsBuyId, String status) {
        this.orderId = orderId;
        this.amount = amount;
        this.clientUserId = clientUserId;
        this.adminUserId = adminUserId;
        this.adminDepId = adminDepId;
        this.logisticsBuyId = logisticsBuyId;
        this.status = status;
    }

    /**
     * 购买业务主键id
     */
    @TableId(value = "order_id")
    private String orderId;

    /**
     * 支付金额
     */
    @TableField("amount")
    private BigDecimal amount;

    /**
     * 分配的机器ids
     */
    @TableField("device_id")
    private Integer deviceId;

    /**
     * 分配的机器codes
     */
    @TableField("device_code")
    private String deviceCode;

    /**
     * 客户id
     */
    @TableField("client_user_id")
    private Integer clientUserId;

    /**
     * 负责人id
     */
    @TableField("admin_user_id")
    private Integer adminUserId;

    /**
     * 部门id
     */
    @TableField("admin_dep_id")
    private Integer adminDepId;

    /**
     * 物流订单号
     */
    @TableField("logistics_buy_id")
    private Integer logisticsBuyId;

    /**
     * 备注
     */
    @TableField("remarks")
    private String remarks;

    /**
     * 状态(未分配/经理/管理/通过)
     */
    @TableField("status")
    private String status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;


}
